
import request from "../request"
/**
 * 物料产品分类查询
 * @param {* 物料产品分类搜索参数} params 
 * @returns json数据格式
 */
export const findMaterial = async (params) => {
    return request.get(`/api/material/find`, {
        params: params
    })
}
/**
 * 新增物料产品分类
 * @param {* 物料产品分类} material 
 * @returns json数据格式
 */
export const insertMaterial = async (material) => {
    return request.post('/api/material/insert', material, {
        headers: { 'Content-Type': 'application/json' }
    })
}
/**
 * 根据id删除物料产品分类
 * @param { * 物料产品分类id} materialId 
 * @returns json数据格式
 */
export const deleteMaterial = async (materialId) => {
    return request.delete(`/api/material/delete`, { params: { materialId } })
}
/**
 * 更新物料产品分类
 * @param { * 物料产品分类} material 
 * @returns json数据格式
 */
export const updateMaterial = async (material) => {
    return request.put('/api/material/update', material, {
        headers: { 'Content-Type': 'application/json' }
    })
}




/**
 * 客户查询
 * @param {* 客户搜索参数} params 
 * @returns json数据格式
 */
export const findCustomer = async (params) => {
    return request.get('/api/customerManagement/find', { params: params })
}

/**
 * 新增客户
 * @param {* 客户} customer 
 * @returns json数据格式
 */
export const insertCustomer = async (customer) => {
    return request.post('/api/customerManagement/insert', customer, {
        headers: { 'Content-Type': 'application/json' }
    })
}


/**
 * 删除客户
 * @param { * 客户id} ids 
 * @returns json数据格式    
 */
export const deleteCustomer = async (ids) => {
    return request.delete('/api/customerManagement/delete', {
        headers: { 'Content-Type': 'application/json' },
        data: ids
    })
}


/**
 * 更新客户
 * @param { * 客户} customer 
 * @returns json数据格式
 */
export const updateCustomer = async (customer) => {
    return request.put('/api/customerManagement/update', customer, {
        headers: { 'Content-Type': 'application/json' }
    })
}

/**
 * 供应商查询
 * @param {* 供应商搜索参数} params 
 * @returns json数据格式
 */
export const findSupplier = async (params) => {
    return request.get('/api/vendorManagement/find', { params: params })
}


/**
 * 新增供应商
 * @param {*供应商 } Supplier 
 * @returns json数据格式
 */
export const insertsupplier = async (Supplier) => {
    return request.post('/api/vendorManagement/insert', Supplier, {
        headers: { 'Content-Type': 'application/json' }
    })
}

/**
 * 更新供应商
 * @param { * 供应商} customer 
 * @returns json数据格式
 */
export const updatesupplier = async (Supplier) => {
    return request.put('/api/vendorManagement/update', Supplier, {
        headers: { 'Content-Type': 'application/json' }
    })
}

/**
 * 删除供应商
 * @param { * 供应商id} ids
 * @returns json数据格式    
 */
export const deletespplier = async (ids) => {
    return request.delete('/api/vendorManagement/delete', {
        headers: { 'Content-Type': 'application/json' },
        data: ids
    })
}


/**
 * 工作站查询
 * 
 * @param {* 工作站搜索参数} params 
 * @returns json数据格式
 */
export const findWorkstation = async (params) => {
    return request.get('/api/workstation/find', { params: params })
}



/**
 *添加工作站
 * @param {* 工作站} workstation 
 * @returns json数据格式
 */
export const insertWorkstation = async (workstation) => {
    return request.post('/api/workstation/insert', workstation, {
        headers: { 'Content-Type': 'application/json' }
    })
}

/**
 * 删除工作站
 * @param { * 工作站id} ids 
 * @returns json数据格式    
 */
export const deleteWorkstation = async (ids) => {
    return request.delete('/api/workstation/delete', {
        headers: { 'Content-Type': 'application/json' },
        data: ids
    })
}

/**
 * 更新工作站
 * @param { * 工作站} workstation 
 * @returns json数据格式
 */
export const updateWorkstation = async (workstation) => {
    return request.put('/api/workstation/update', workstation, {
        headers: { 'Content-Type': 'application/json' }
    })
}


/**
 * 查询产品物料
 * @param {* 产品物料搜索参数} params 
 * @returns json数据格式
 */
export const findmaterialManagement = async (params) => {
    return request.get('/api/materialManagement/find', { params: params })
}

/**
 * 新增产品物料
 * @param {* 产品物料} materialManagement 
 * @returns json数据格式
 */
export const insertmaterialManagement = async (materialManagement) => {
    return request.post('/api/materialManagement/insert', materialManagement, {
        headers: { 'Content-Type': 'application/json' }
    })
}

/**
 * 删除产品物料
 * @param { * 产品物料id} ids 
 * @returns json数据格式    
 */
export const deletematerialManagement = async (ids) => {
    return request.delete('/api/materialManagement/delete', {
        headers: { 'Content-Type': 'application/json' },
        data: ids
    })
}

/**
 * 更新产品物料
 * @param { * 产品物料} materialManagement 
 * @returns json数据格式
 */
export const updatematerialManagement = async (materialManagement) => {
    return request.put('/api/materialManagement/update', materialManagement, {
        headers: { 'Content-Type': 'application/json' }
    })
}

/**
 * 查询bom物料产品
 */
export const findBomMaterial = async (param) => {
    return request.get('/api/boms/find', { params: param })
}

/**
 * 新增bom物料产品
 */
export const insertBomMaterial = async (bom) => {
    return request.post('/api/boms/insert', bom, {
        headers: { 'Content-Type': 'application/json' }
    })
}

/**
 * 修改bom物料产品
 */
export const updateBomMaterial = async (bom) => {
    return request.put('/api/boms/update', bom, {
        headers: { 'Content-Type': 'application/json' }
    })
}

/**
 * 删除bom物料产品
 */
export const deleteBomMaterial = async (idsbom) => {
    return request.delete('/api/boms/delete', {
        headers: { 'Content-Type': 'application/json' },
        data: idsbom
    })
}

/**
 * 查询仓库
 */
export const findWarehouses = async (param) => {
    return request.get('/api/warehouseSettings/find', { params: param })
}


/**
 * 查询仓库集合
 */
export const findWarehousesList = async () => {
    return request.get('/api/warehouseSettings/findlist')
}


/**
 * 新增仓库
 */
export const insertWarehouses = async (warehouse) => {
    return request.post('/api/warehouseSettings/insert', warehouse, {
        headers: { 'Content-Type': 'application/json' }
    })
}

/**
 * 修改仓库
 */
export const updateWarehouses = async (warehouse) => {
    return request.put('/api/warehouseSettings/update', warehouse, {
        headers: { 'Content-Type': 'application/json' }
    })
}

/**
 * 删除仓库
 */
export const deleteWarehouses = async (ids) => {
    return request.delete('/api/warehouseSettings/delete', {
        headers: { 'Content-Type': 'application/json' },
        data: ids
    })
}

/**
 * 查询库区
 */
export const findAreas = async (param) => {
    return request.get('/api/warehouseArea/find', { params: param })
}

/**
 * 新增库区
 */
export const insertAreas = async (area) => {
    return request.post('/api/warehouseArea/insert', area, {
        headers: { 'Content-Type': 'application/json' }
    })
}

/**
 * 修改库区
 */
export const updateAreas = async (area) => {
    return request.put('/api/warehouseArea/update', area, {
        headers: { 'Content-Type': 'application/json' }
    })
}

/**
 * 删除库区
 */
export const deleteAreas = async (ids) => {
    return request.delete('/api/warehouseArea/delete', {
        headers: { 'Content-Type': 'application/json' },
        data: ids
    })
}
/**
 * 查询库位
 */
export const findLocations = async (param) => {
    return request.get('/api/warehouseLocation/find', { params: param })
}

/**
 * 新增库位
 */
export const insertLocations = async (location) => {
    return request.post('/api/warehouseLocation/insert', location, {
        headers: { 'Content-Type': 'application/json' }
    })
}

/**
 * 修改库位
 */
export const updateLocations = async (location) => {
    return request.put('/api/warehouseLocation/update', location, {
        headers: { 'Content-Type': 'application/json' }
    })
}

/**
 * 删除库位
 */
export const deleteLocations = async (ids) => {
    return request.delete('/api/warehouseLocation/detele', {
        headers: { 'Content-Type': 'application/json' },
        data: ids
    })
}

/**
 * 查询库存
 */
export const findStock = async (param) => {
    return request.get('/api/warehouSeonhand/find', { params: param })
}


/**
 * 查询入库单
 */
export const findrkd = async (param) => {
    return request.get('/api/procurementWarehousing/find', { params: param })
}

/**
 * 新增入库单
 */
export const insertrkd = async (rkd) => {
    return request.post('/api/procurementWarehousing/insert', rkd, {
        headers: { 'Content-Type': 'application/json' }
    })
}

/**
 * 修改入库单
 */
export const updaterkd = async (rkd) => {
    return request.put('/api/procurementWarehousing/update', rkd, {
        headers: { 'Content-Type': 'application/json' }
    })
}

/**
* 删除入库单   
* @param { * 入库单id} ids 
* @returns json数据格式    
*/
export const deleterkd = async (ids) => {
    return request.delete('/api/procurementWarehousing/delete', {
        headers: { 'Content-Type': 'application/json' },
        data: ids
    })
}

/**
 * 查询物料信息
 */
export const findline = async (param) => {
    return request.get('/api/line/find', { params: param })
}


/**
 * 新增物料信息
 */
export const insertline = async (line) => {
    return request.post('/api/line/insert', line, {
        headers: { 'Content-Type': 'application/json' }
    })
}

/**
 * 修改物料信息
 */
export const updateline = async (line) => {
    return request.put('/api/line/update', line, {
        headers: { 'Content-Type': 'application/json' }
    })
}

/**
 * 删除物料信息
 */
export const deleteline = async (idswl) => {
    return request.delete('/api/line/delete', {
        headers: { 'Content-Type': 'application/json' },
        data: idswl
    })
}

/**
 * 添加库存信息
 */
export const insertStock = async (stock) => {
    return request.post('/api/warehouSeonhand/insert', stock, {
        headers: { 'Content-Type': 'application/json' }
    })
}


/**
 * 查询产品入库单
 */
export const findProductRKD = async (param) => {
    return request.get('/api/reversoContext/find', { params: param })
}

//查询工单
export const findWorkOrder = async (param) => {
    return request.get('/api/processTickets/findStatus', { params: param })
}

//新增产品入库单
export const insertProductRKD = async (rkd) => {
    return request.post('/api/reversoContext/insert', rkd, {
        headers: { 'Content-Type': 'application/json' }
    })
}

//修改产品入库单
export const updateProductRKD = async (rkd) => {
    return request.put('/api/reversoContext/update', rkd, {
        headers: { 'Content-Type': 'application/json' }
    })
}

//删除产品入库单
export const deleteProductRKD = async (ids) => {
    return request.delete('/api/reversoContext/delete', {
        headers: { 'Content-Type': 'application/json' },
        data: ids
    })
}


/**
 * 查询产品信息
 */
export const findline2 = async (param) => {
    return request.get('/api/line/findline', { params: param })
}

//新增产品信息
export const insertline2 = async (line) => {
    return request.post('/api/line/insertline', line, {
        headers: { 'Content-Type': 'application/json' }
    })
}
/**
 * 修改产品信息
 */
export const updateline2 = async (line) => {
    return request.put('/api/line/updateline', line, {
        headers: { 'Content-Type': 'application/json' }
    })
}

/**
 * 删除产品信息
 */
export const deleteline2 = async (idscp) => {
    return request.delete('/api/line/deleteline', {
        headers: { 'Content-Type': 'application/json' },
        data: idscp
    })
}


//查询工单内产品
export const fedback = async (param) => {
    return request.get('/api/processTickets/findtow', { params: param })
}





































